{{extend 'layout.html'}}

<div class="ui-body ui-body-c ui-corner-all">
  <h1>{{=page.title}}</h1>
  {{=MARKMIN(page.header)}}
  <br/><br/>
  {{for tag in tags:}}
  <a data-inline="true" href={{=URL('bytag', vars=dict(tag=tag.name))}} data-role="button">{{=tag.name}}</a>
  {{pass}}
  {{if auth.user:}}
  <a data-inline="true" data-role="button" rel="external" href="{{=URL('edit',args=page.id)}}" data-transition="pop" data-theme="e">edit</a>
  {{pass}}
</div>

{{if subfolders:}}
<ul data-role="listview" data-inset="true">
  <li data-role='list-divider'>Pages</li>
  {{for child in subfolders:}}
  <li><a href="{{=URL(args=child.path)}}">{{=name(child.title)}}</a></li>
  {{pass}}
</ul> 
{{pass}}

{{if patterns:}}
<ul data-role="listview" data-inset="true">  
  <li data-role='list-divider'>Files and File Patterns</li>
  {{for pattern in patterns:}}
  <li><a data-transition="pop" href="{{=URL('files',args=(page.path,pattern.catalog_file.pattern))}}">{{=pattern.catalog_file.pattern}} ({{=pattern(db.catalog_file.mtime.year())}}, {{=pattern(db.catalog_file.id.count())}} files, {{=bytes(pattern(db.catalog_file.size.sum()))}})</a></li>
  {{pass}}
</ul>
{{pass}}

<div>
  {{=MARKMIN(page.footer)}}
</div>

{{if page.comments:}}
{{=plugin_wiki.widget('comments','catalog_folder',page.id)}}
{{pass}}


